附:中文汉化包
前言
安装语言包
术语解释
汉化修改
自定义帮助
多语种单据
多语种单据
集中维护
PO词条
关于element
翻译tips
翻译TODO
CKEditor
load: function(a, e, b) {
if (!a || !CKEDITOR.lang.languages[a]) a = this.detect(e, a);
var c = this,
e = function() {
c[a].dir = c.rtl[a] ? "rtl": "ltr";
b(a, c[a])
};
this[a] ? e() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), e, this)
},
detect: function(a, e) {
var b = this.languages,
e = e || navigator.userLanguage || navigator.language || a,
c = e.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/), /* 就是这里 */
f = c[1],
c = c[2];
b[f + "-" + c] ? f = f + "-" + c: b[f] || (f = null);
CKEDITOR.lang.detect = f ?
function() {
return f
}: function(a) {
return a
};
return f || a
}
脚本
Referred: https://yq.aliyun.com/articles/72088
UTF8编码: 字段~ '[\u2e80-\ua4cf]|[\uf900-\ufaff]|[\ufe30-\ufe4f]' 或者 ~ '[^(\x00-\x7f)]'
//正则匹配
https://github.com/digoal/blog/blob/master/201704/20170412_03.md
匹配中文字符的正则表达式: [\u4e00-\u9fa5]
匹配双字节字符(包括汉字在内):[^\x00-\xff]
匹配空行的正则表达式:\n[\s| ]*\r
匹配HTML标记的正则表达式:/<(.*)>.*<\/\1>|<(.*) \/>/
匹配首尾空格的正则表达式:(^\s*)|(\s*$)(像vbscript那样的trim函数)
匹配Email地址的正则表达式:\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*
匹配网址URL的正则表达式:http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?
select name,ad_printformatitem_id from ad_printformatitem_trl
where ad_printformatitem_id in (select ad_printformatitem_id from ad_printformatitem
where ad_column_id in (select ad_column_id from ad_column
where ad_column_id in (select ad_column_id from ad_field
where ad_field_id in (1,2,9))));
/* pgScript 更新某个词条为其他行业的词条 */
/* 步骤:依次更新ad_element,ad_window,ad_tab,ad_table,ad_process,ad_infowindow,ad_menu */
/* 重点:最后运行“同步词条” */
SET @ng_name= '产品'; /* 错误词条 */
SET @ok_name = '商品'; /* 正确词条 */
BEGIN
/* step1:翻译ad_element_trl */
UPDATE ad_element_trl SET
name = REPLACE(name, '@ng_name', '@ok_name'),
printname = REPLACE(printname, '@ng_name', '@ok_name'),
description= REPLACE(description, '@ng_name', '@ok_name'),
help = REPLACE(help, '@ng_name', '@ok_name'),
po_name = REPLACE(po_name, '@ng_name', '@ok_name'),
po_printname = REPLACE(po_printname, '@ng_name', '@ok_name'),
po_description= REPLACE(po_description, '@ng_name', '@ok_name'),
po_help = REPLACE(po_help, '@ng_name', '@ok_name') ;
/* step2:翻译ad_window_trl */
UPDATE ad_window_trl SET
name = REPLACE(name, '@ng_name', '@ok_name'),
description= REPLACE(description, '@ng_name', '@ok_name'),
help = REPLACE(help, '@ng_name', '@ok_name');
/* step3:翻译ad_tab_trl */
UPDATE ad_tab_trl SET
name = REPLACE(name, '@ng_name', '@ok_name'),
description= REPLACE(description, '@ng_name', '@ok_name'),
help = REPLACE(help, '@ng_name', '@ok_name');
/* step4:翻译ad_table_trl */
UPDATE ad_table_trl SET
name = REPLACE(name, '@ng_name', '@ok_name');
/* step5:翻译ad_process_trl */
UPDATE ad_process_trl SET
name = REPLACE(name, '@ng_name', '@ok_name'),
description= REPLACE(description, '@ng_name', '@ok_name'),
help = REPLACE(help, '@ng_name', '@ok_name');
/* step6:翻译ad_infowindow_trl */
UPDATE ad_infowindow_trl SET
name = REPLACE(name, '@ng_name', '@ok_name'),
description= REPLACE(description, '@ng_name', '@ok_name'),
help = REPLACE(help, '@ng_name', '@ok_name');
/* step7:翻译ad_menu_trl,菜单文件夹无法同步 */
UPDATE ad_menu_trl SET
name = REPLACE(name, '@ng_name', '@ok_name'),
description= REPLACE(description, '@ng_name', '@ok_name');
END
/* step1:更新ad_field 集中维护=N */
update ad_field fd
set IsCentrallyMaintained='N'
where fd.ad_tab_id in (select f.ad_tab_id from ad_field f where f.name ~ 'Partner' )
and fd.name = 'User/Contact'
update ad_field fd
set IsCentrallyMaintained='N'
where fd.ad_field_id in (12240,7625,5875) /* 三个手工识别的”联系人“ */
and fd.name = 'User/Contact'
/* step2:更新ad_field_trl 把”联系人/用户“ 翻译成”联系人“ */
update ad_field_trl set
name='联系人' ,
description ='业务伙伴的联系人',
help ='业务伙伴的联系人,可以使用名称和密码登录到系统。'
where ad_field_id
in (select ad_field_id from ad_field where name='User/Contact' and ad_tab_id
in (select ad_tab_id from ad_field where name='Partner Location')) or ad_field_id in (12240,7625,5875) ;
/* step3:更新ad_field 集中维护=N */
update ad_field fd
set IsCentrallyMaintained='N'
where fd.ad_tab_id in (select ad_tab_id from ad_tab where name ~ '^Activit' and ad_tab_id > 53400)
and fd.name = 'User/Contact'
/* step4:更新ad_field_trl 把”联系人/用户“ 翻译成”线索“ */
update ad_field_trl set
name='线索' ,
description ='销售线索',
help ='销售的线索'
where ad_field_id
in (select ad_field_id from ad_field where name='User/Contact' and ad_tab_id
in (select ad_tab_id from ad_tab where name ~ '^Activit' and ad_tab_id > 53400));
/* step5: 剩余默认都是”用户“ */
select f.ad_field_id ,w.name as w_name , b.name as tab_name, t.tablename,t.accesslevel
from ad_field f
join ad_tab b on f.ad_tab_id=b.ad_tab_id
join ad_window w on w.ad_window_id=b.ad_window_id
join ad_table t on t.ad_table_id=b.ad_table_id
where f.name='User/Contact' and f.IsCentrallyMaintained='Y' and b.isactive='Y' AND t.isactive='Y' and w.isactive='Y'
order by 5,4
update ad_element_trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update ad_column_trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update ad_field_trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update ad_process_para_trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update ad_infocolumn_trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update ad_printformatitem_trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update AD_Window_Trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update AD_Tab_Trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update AD_Table_Trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
update AD_Message_Trl set istranslated='Y' where istranslated='N' and msgtext ~ '[^(\x00-\x7f)]';
update AD_Reference_Trl set istranslated='Y' where istranslated='N' and name ~ '[^(\x00-\x7f)]';
\* 替换小写。 *\
update ad_field_trl set help=replace(help,'.','。') where help ~'[^(\x00-\x7f)]\.'
\* 替换小写, *\
update ad_field_trl set help=replace(help,':',':') where help ~'[^(\x00-\x7f)]' and help ~','
\* 替换小写: *\
update ad_field_trl set help=replace(help,':',':') where help ~'[^(\x00-\x7f)]:' and help ~':' and help !~'http'
\* 替换小写( *\
update ad_field_trl set help=replace(help,'(','(') where help ~'[^(\x00-\x7f)]' and help ~'\('
\* 替换小写) *\
update ad_field_trl set help=replace(help,')',')') where help ~'[^(\x00-\x7f)]' and help ~'\)'
\* help加上句话 *\
update ad_field_trl set help=help || '。' where help !~'。$' and help ~'[^(\x00-\x7f)]'
select count(*) from ad_element_trl where istranslated='N'
union
select count(*) from ad_column_trl where istranslated='N'
union
select count(*) from ad_field_trl where istranslated='N'
union
select count(*) from ad_printformatitem_trl where istranslated='N'
NO/ALL 结果@2017-10-31
195 / 5895
404 / 20783
166 / 14290
114 / 26524